package com.tinem.platform.module.starter.jpa.entity.pay;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author fzh
 * @version v1
 * @program: platform
 * @className Order
 * @description 订单表
 * @site
 * @company
 * @create 2021-11-5
 */
@Data
@Entity
@ToString
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
@Table(name="t_order")
@ApiModel("订单表")
public class Order implements Serializable,Cloneable{
    @Id
    @Column(name = "c_id",nullable=true)
    @ApiModelProperty(name = "id", value = "ID",required = true)
    private String id;

    @Column(name = "c_client_id",nullable=true)
    @ApiModelProperty(name = "clientId", value = "客户端Id",required = true)
    private String clientId;

    @Column(name = "c_merch_order_ori_id",nullable=true)
    @ApiModelProperty(name = "merchOrderOriId", value = "商户原始订单号;由商户网站生成,在商户网站后台查询该订单的订单号",required = true)
    private String merchOrderOriId;

    @Column(name = "c_pay_user_email",nullable=true)
    @ApiModelProperty(name = "payUserEmail", value = "支付用户联系邮箱",required = true)
    private String payUserEmail;

    @Column(name = "c_pay_user_phone_country",nullable=true)
    @ApiModelProperty(name = "payUserPhoneCountry", value = "支付用户联系手机国家",required = true)
    private String payUserPhoneCountry;

    @Column(name = "c_pay_user_phone",nullable=true)
    @ApiModelProperty(name = "payUserPhone", value = "支付用户联系手机",required = true)
    private String payUserPhone;

    @Column(name = "c_description",nullable=true)
    @ApiModelProperty(name = "description", value = "订单描述",required = true)
    private String description;

    @Column(name = "c_order_type",nullable=true)
    @ApiModelProperty(name = "orderType", value = "支付方式",required = true)
    private String orderType;

    @Column(name = "c_ifs_url",nullable=true)
    @ApiModelProperty(name = "ifsUrl", value = "在内嵌支付iframe页面用到的css文件的url;(必须https)如果“order_type=3内嵌支付”，该字段可填；否则该字段为空。",required = true)
    private String ifsUrl;

    @Column(name = "c_merch_order_date",nullable=true)
    @ApiModelProperty(name = "merchOrderDate", value = "商户订单时间;格式：YYYYMMDDHHMMSS。例如：20180731235959",required = true)
    private Date merchOrderDate;

    @Column(name = "c_time_expire",nullable=true)
    @ApiModelProperty(name = "timeExpire", value = "交易结束时间",required = true)
    private Date timeExpire;

    @Column(name = "c_price_currency",nullable=true)
    @ApiModelProperty(name = "priceCurrency", value = "标价币种;具体支持的币种需要向销售确认",required = true)
    private String priceCurrency;

    @Column(name = "c_price_amount",nullable=true)
    @ApiModelProperty(name = "priceAmount", value = "标价金额;格式：保留两位小数的金额。例如：263.50",required = true)
    private java.math.BigDecimal priceAmount;

    @Column(name = "c_ip",nullable=true)
    @ApiModelProperty(name = "ip", value = "持卡人的IP地址",required = true)
    private String ip;

    @Column(name = "c_url_sync",nullable=true)
    @ApiModelProperty(name = "urlSync", value = "订单状态异步回调地址",required = true)
    private String urlSync;

    @Column(name = "c_url_succ_back",nullable=true)
    @ApiModelProperty(name = "urlSuccBack", value = "成功订单返回地址;待处理状态的订单也返回该网址",required = true)
    private String urlSuccBack;

    @Column(name = "c_url_fail_back",nullable=true)
    @ApiModelProperty(name = "urlFailBack", value = "失败订单返回地址",required = true)
    private String urlFailBack;

    @Column(name = "c_url_opt_channel",nullable=true)
    @ApiModelProperty(name = "urlOptChannel", value = "订单支付渠道选择回调地址",required = true)
    private String urlOptChannel ;

    @Column(name = "c_web_site",nullable=true)
    @ApiModelProperty(name = "webSite", value = "订单发起网站",required = true)
    private String webSite ;

    @Column(name = "c_order_remark",nullable=true)
    @ApiModelProperty(name = "orderRemark", value = "订单备注;回传商户订单状态时，会包含该字段",required = true)
    private String orderRemark;

    @Column(name = "c_order_status",nullable=true)
    @ApiModelProperty(name = "orderStatus", value = "订单支付状态",required = true)
    private Integer orderStatus;

    @Column(name = "c_order_pay_id",nullable=false)
    @ApiModelProperty(name = "orderPayId", value = "订单支付记录编号",required = false)
    private String orderPayId;

    @Column(name = "c_order_message",nullable=true)
    @ApiModelProperty(name = "orderMessage", value = "订单支付消息",required = true)
    private String orderMessage;

    @Version
    @Column(name = "c_revision",nullable=true)
    @ApiModelProperty(name = "revision", value = "乐观锁",required = false)
    private Integer revision;

    @Column(name = "c_created_by",nullable=true)
    @ApiModelProperty(name = "createdBy", value = "创建人",required = false)
    private String createdBy;

    @Column(name = "c_created_time",nullable=true,insertable = false,updatable = false)
    @ApiModelProperty(name = "createdTime", value = "创建时间",required = false)
    private Date createdTime;

    @Column(name = "c_updated_by",nullable=true)
    @ApiModelProperty(name = "updatedBy", value = "更新人",required = false)
    private String updatedBy;

    @Column(name = "c_updated_time",nullable=true,insertable = false,updatable = false)
    @ApiModelProperty(name = "updatedTime", value = "更新时间",required = false)
    private Date updatedTime;

}